/*
 * File:   HardwareConfig.h
 * Author: Twistx77
 *
 * Created on 10 de junio de 2012, 14:38
 */

#ifndef HardwareConfig_H
#define HardwareConfig_H

#define CLOCK_FREQ 48000000
    #define GetSystemClock() CLOCK_FREQ   

#define self_power 0

#define ON   1
#define OFF  0

/*----------------------------LEDS CONFIG--------------------------------------------*/
#define INIT_LEDs()          TRISAbits.TRISA6 = 0;  TRISAbits.TRISA7 = 0; TRISCbits.TRISC0 = 0;
                            

#define LED_PWR             PORTAbits.RA7;
#define LED_VOUT            PORTAbits.RA6;
#define LED_CC              PORTCbits.RC0;

#define LED_PWR_ON()        LED_PWR = ON;

#define LED_PWR_TOGGLE()    PORTAbits.RA7 = !PORTAbits.RA7;
#define LED_VOUT_TOGGLE()   PORTAbits.RA6 = !PORTAbits.RA6;
#define LED_CC_TOGGLE()     PORTCbits.RC0 = !PORTCbits.RC0;

/*----------------------------SWITCH CONFIG----------------------------------------*/
#define INIT_SWITCH()       TRISBbits.RB7 = 1;
#define SWITCH              PORTBbits.RB7;

#define mDataRdyUSART() PIR1bits.RCIF
    #define mTxRdyUSART()   TXSTAbits.TRMT

#endif
